import request from "@/axios";

// 添加/编辑额度
export const updateCredit = option =>
  request({
    url: "/api/company/updatecredit",
    method: "post",
    data: option
  });

// 查询指定客户额度
export const getCustomerCredit = option =>
  request({
    url: "/api/company/getcustomercredit",
    method: "get",
    params: option
  });

// 删除额度
export const deleteCredit = option =>
  request({
    url: "/api/company/deletecredit",
    method: "get",
    params: option
  });

// 获取指定供应商的额度
export const getProviderCredit = option =>
  request({
    url: "/api/company/getprovidercredit",
    method: "get",
    params: option
  });

// 采购额度申请
export const purchaseCredit = option =>
  request({
    url: "/api/company/purchasecreditrequest",
    method: "post",
    data: option
  });

// 审批采购额度
export const approveCredit = option =>
  request({
    url: "/api/company/approvecreditrequest",
    method: "post",
    data: option
  });

// 修改申请的额度
export const updateprovidercredit = option =>
  request({
    url: "/api/company/updateprovidercredit",
    method: "post",
    data: option
  });

// 根据合约月查询客户额度
export const queryCustomerQuotaByContract = option =>
  request({
    url: "/api/company/getcustomercreditbyfuturescontractcode",
    method: "get",
    params: option
  });

// 根据合约月查询供应商额度
export const querySupplierQuotaByContract = option =>
  request({
    url: "/api/company/getprovidercreditbyfuturescontractcode",
    method: "get",
    params: option
  });

// 批量修改额度记录
export const getcompanycreditbatchupdatelog = option =>
  request({
    url: "/api/company/getcompanycreditbatchupdatelogpage",
    method: "post",
    data: option
  });

// 批量修改额度
export const updatebatchcredit = option =>
  request({
    url: "/api/company/updatebatchcredit",
    method: "post",
    data: option
  });
